<?php
    class Event implements iModel {
    	public $eventId;
		public $name;
		public $picture;
		public $pictureUrl;
		public $startDate;
		public $endDate;
		public $description;
		public $type;
		public $eventUser;
		
		public function __construct() {
			$this->setEventUser(new EventUser());
		}
		
		public function getEventId() {
			 return $this->eventId; 
		} 
		
		public function getName() {
			 return $this->name; 
		}
		 
		public function getPicture() {
			return $this->picture;
		}
		
		public function getPictureUrl() {
			return $this->pictureUrl;
		}
		 
		public function getStartDate() {
			 return $this->startDate; 
		}
		 
		public function getEndDate() {
			 return $this->endDate; 
		}
		 
		public function getDescription() {
			 return $this->description; 
		}
		 
		public function getType() {
			 return $this->type; 
		}
		
		public function getEventUser() {
			return $this->eventUser; 
		}
		 
		public function getEventItemsList() {
			 return $this->eventItemsList; 
		}
		 
		public function getEventAttendantsList() {
			 return $this->eventAttendantsList; 
		}
		 
		public function setEventId($eventId) {
			 $this->eventId = $eventId; 
		} 
		
		public function setName($name) {
			 $this->name = $name; 
		}
		 
		public function setPicture($picture) {
			$this->picture = $picture;
			$this->setPictureUrl(getImageFolderUrl('event') . $this->getPicture());
		} 
		
		public function setPictureUrl($pictureUrl) {
			$this->pictureUrl = $pictureUrl;
		} 
		 
		public function setStartDate($startDate) {
			 $this->startDate = $startDate; 
		}
		 
		public function setEndDate($endDate) {
			 $this->endDate = $endDate; 
		}
		 
		public function setDescription($description) {
			 $this->description = $description; 
		}
		 
		public function setType($type) {
			 $this->type = $type; 
		}
		
		public function setEventUser($eventUser) {
			$this->eventUser = $eventUser; 
		}
		 
		public function setEventItemsList($eventItemsList) {
			 $this->eventItemsList = $eventItemsList; 
		}
		 
		public function setEventAttendantsList($eventAttendantsList) {
			 $this->eventAttendantsList = $eventAttendantsList; 
		}
		
		public function JSONToObject($eventJSON) {
			$this->setDescription($eventJSON->description);	
			$this->setName($eventJSON->name);
			$this->setStartDate($eventJSON->startDate);
			$this->setEndDate($eventJSON->endDate);
			$this->setPicture($eventJSON->picture);
			$this->setType($eventJSON->type);
			
			$eventUser = new EventUser();
			$eventUser->JSONToObject($eventJSON->eventUser);
			$this->setEventUser($eventUser);
		}
    }
?>